﻿<UserControl x:Class="PicturePortfolio.Silverlight.Views.UploadPhotoView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:ca="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" Width="500" MaxHeight="400" Background="White">
    <UserControl.Resources>
        
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Border Background="White" BorderThickness="1" BorderBrush="Gray">
            <Grid Margin="6" Background="Black">
                <Grid.RowDefinitions>
                    <RowDefinition Height="50"></RowDefinition>
                    <RowDefinition></RowDefinition>
                    <RowDefinition Height="30"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition Width="50"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="5">
                    <TextBlock  Text="Browse Photo" Height="19" Width="79" Foreground="White"></TextBlock>
                    <Button x:Name="BrowseButtonClicked" Width="38" Height="38" Background="Black">
                        <Grid Height="32" Width="32">
                            <Grid.Background>
                                <ImageBrush Stretch="Fill" ImageSource="/open_folder.png"/>
                            </Grid.Background>
                        </Grid>
                    </Button>
                    <TextBlock Text="Category" Height="19" Foreground="White" Margin="10,0,0,0"></TextBlock>
                    <ComboBox x:Name="Categories" SelectedItem="SelectedCategory" Height="30" Width="160">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <ca:ActionMessage MethodName="CategorySelectionChanged">
                                    <ca:Parameter Value="{Binding ElementName=Categories,Path=SelectedItem}"></ca:Parameter>
                                </ca:ActionMessage>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <ComboBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock x:Name="CategoryName" Text="{Binding CategoryName}"></TextBlock>
                                </StackPanel>
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>
                </StackPanel>
                <Button x:Name="Upload" Grid.Row="0" Grid.Column="1" Width="43" Height="43"  HorizontalAlignment="Right" Margin="5">
                    <Grid Height="30" Width="30">
                        <Grid.Background>
                            <ImageBrush Stretch="Fill" ImageSource="/save_accept.png"/>
                        </Grid.Background>
                    </Grid>
                </Button>
                <!--<toolkit:BusyIndicator  x:Name="IsBusy">-->
                 <ScrollViewer Grid.Row="1" Grid.ColumnSpan="2"   VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Width="Auto" BorderThickness="1">
                    <ListBox x:Name="PhotosToUpload" ScrollViewer.HorizontalScrollBarVisibility="Disabled" BorderThickness="0" Background="Transparent">
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <toolkit:WrapPanel HorizontalAlignment="Stretch"  Orientation="Horizontal" Background="Transparent"/>
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Border BorderBrush="Transparent" 
							            BorderThickness="1" 
							            CornerRadius="0" 
							            Background="Black" Margin="1">
                                    <ContentControl ca:View.Model="{Binding}" Margin="0"/>
                                </Border>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </ScrollViewer>
                <TextBlock Grid.Row="2"  HorizontalAlignment="Left" Name="StatusMessage" Foreground="White"/>
                <!--</toolkit:BusyIndicator>-->
                
            </Grid>
        </Border>
    </Grid>
</UserControl>
